public class TestBinarySearchTree {

    public static void main(String[] args) {
        BinarySearchTree binarySearchTree = new BinarySearchTree();
        binarySearchTree.insert(16);
        binarySearchTree.insert(10);
        binarySearchTree.insert(20);
        binarySearchTree.insert(15);
        binarySearchTree.insert(6);
        binarySearchTree.insert(12);
        binarySearchTree.insert(25);
        binarySearchTree.insert(23);
        binarySearchTree.insert(17);
        binarySearchTree.insert(19);
        BinarySearchTree.TreeNode head = binarySearchTree.Convert(binarySearchTree.root);
        while(head != null) {
            System.out.print(head.key + " ");
            head = head.right;
        }
//        binarySearchTree.inOrder(binarySearchTree.root);
//        System.out.println();
//        binarySearchTree.remove(17);
//        binarySearchTree.inOrder(binarySearchTree.root);
//        System.out.println();
//        binarySearchTree.remove(10);
//        binarySearchTree.inOrder(binarySearchTree.root);
//        System.out.println();
//        binarySearchTree.remove(16);
//        binarySearchTree.inOrder(binarySearchTree.root);
//
//        System.out.println();
//        System.out.println(binarySearchTree.search(20));
    }

}
